//jumping when above ground
if(aboveGround){
    //initially pressed
    if(onFloor && (keyUpPressed || keyJumpPressed))
        dy=-jumpVelocity;    
    //held in
    if(keyUpHeld || keyJumpHeld) 
        dy-=jumpVelocity*jumpModifier;
    
//jumping when below ground
}else{
    //initially pressed (below)
    if(onFloor && (keyDownPressed || keyJumpPressed))
        dy=jumpVelocity;
    //held in (below)
    if(keyDownHeld || keyJumpHeld) 
        dy+=jumpVelocity*jumpModifier;
}

